/**
 * Created with IntelliJ IDEA.
 * User: render
 * Date: 12-12-5
 * Time: 下午5:29
 * To change this template use File | Settings | File Templates.
 */

(function(){
    fl.runScript(fl.configURI + "jsfl/core.jsfl");

    var d = dom();
    var l = lib();
    var t = tl();
    var lay = cur_layer();
    var stFrm = 0;

    var its = $('lib').s().get();
    tl.currentFrame = stFrm;
    its.forEach(function(it, ind){
        tl.currentFrame = stFrm + ind;
        if(lay.frames.length - 1 < stFrm + ind){
            t.insertBlankKeyframe();
        }
        l.selectItem(it.name);
        l.addItemToDocument({x: d.width / 2, y: d.height / 2 }, it.name);
    });


})();